package com.ruoyi.web.controller.websocket;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.domain.R;

import io.swagger.annotations.ApiOperation;
@RequestMapping("/a")
@RestController
public class smsController {
	
	@Autowired
	private smsServiceImpl userService;
    /**
     * 发送验证码
     * @param phoneNumber
     * @return
     */
	@Anonymous
    @ApiOperation("发送验证码")
    @PostMapping("/sendCode")
    public R sendCode(String phoneNumber) {
        boolean isSend = userService.send(phoneNumber);
        if (isSend){
            return R.ok();
        }else {
            return R.fail("短信发送失败！");
        }
    }
}
